-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove TypeRegistry re-export rename #9807
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The rename is confusing. Each time I import `TypeRegistry` I have to think at least 10 seconds about how to import it. And I've been working a lot of bevy reflect, which multiplies the papercut. When I "go to definition" on `TypeRegistry` I get to `TypeRegistryArc`. And when I mean `TypeRegistry` in my function signature, 100% of the time I mean `TypeRegistry`, not the arc wrapper. Rust has borrowing, and most use-cases of the TypeRegistry accepts borrow of the registry, with no need to mutate it. `TypeRegistryInternal` is also confusing. In bevy crates, it doesn't exist. It only exists in the bevy re-exports. It makes it hard to understand which names qualifies which types.
nicopap
added
A-Reflection
Runtime information about types
M-Needs-Migration-Guide
A breaking change to Bevy's public API that needs to be noted in a migration guide
labels
Sep 14, 2023
james7132
approved these changes
Sep 14, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Definitely stuck out like a sore thumb in the public interface.
MrGVSV
approved these changes
Sep 14, 2023
cart
approved these changes
Sep 14, 2023
I lost 30 min yesterday trying to understand a compiler error due to this, with no help from documentation. Definitely a much welcome change, thanks! 😊 |
rdrpenguin04
pushed a commit
to rdrpenguin04/bevy
that referenced
this pull request
Jan 9, 2024
# Objective The rename is confusing. Each time I import `TypeRegistry` I have to think at least 10 seconds about how to import it. And I've been working a lot with bevy reflect, which multiplies the papercut. In my crates, you can find lots of: ```rust use bevy::reflect::{TypeRegistryInternal as TypeRegistry}; ``` When I "go to definition" on `TypeRegistry` I get to `TypeRegistryArc`. And when I mean `TypeRegistry` in my function signature, 100% of the time I mean `TypeRegistry`, not the arc wrapper. Rust has borrowing, and most use-cases of the TypeRegistry accepts borrow of the registry, with no need to mutate it. `TypeRegistryInternal` is also confusing. In bevy crates, it doesn't exist. The bevy crate documentation often refers to `TypeRegistry` and link to `TypeRegistryInternal`. It only exists in the bevy re-exports. It makes it hard to understand which names qualifies which types. ## Solution Remove the rename, keep the type names as they are in `bevy_reflect` --- ## Changelog - Remove `TypeRegistry` and `TypeRegistryArc` renames from bevy `bevy_reflect` re-exports. ## Migration Guide - `TypeRegistry` as re-exported by the wrapper `bevy` crate is now `TypeRegistryArc` - `TypeRegistryInternal` as re-exported by the wrapper `bevy` crate is now `TypeRegistry`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-Reflection
Runtime information about types
M-Needs-Migration-Guide
A breaking change to Bevy's public API that needs to be noted in a migration guide
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Objective
The rename is confusing. Each time I import
TypeRegistry
I have to think at least 10 seconds about how to import it. And I've been working a lot with bevy reflect, which multiplies the papercut.In my crates, you can find lots of:
When I "go to definition" on
TypeRegistry
I get toTypeRegistryArc
. And when I meanTypeRegistry
in my function signature, 100% of the time I meanTypeRegistry
, not the arc wrapper.Rust has borrowing, and most use-cases of the TypeRegistry accepts borrow of the registry, with no need to mutate it.
TypeRegistryInternal
is also confusing. In bevy crates, it doesn't exist. The bevy crate documentation often refers toTypeRegistry
and link toTypeRegistryInternal
. It only exists in the bevy re-exports. It makes it hard to understand which names qualifies which types.Solution
Remove the rename, keep the type names as they are in
bevy_reflect
Changelog
TypeRegistry
andTypeRegistryArc
renames from bevybevy_reflect
re-exports.Migration Guide
TypeRegistry
as re-exported by the wrapperbevy
crate is nowTypeRegistryArc
TypeRegistryInternal
as re-exported by the wrapperbevy
crate is nowTypeRegistry